<template>
    <div>
         角色名称：<input type="text" v-model="name"><br/>
         备注:
        <el-input
                type="textarea"
                :rows="5"
                placeholder="请输入内容"
                v-model="remarks">
        </el-input>
        <br/>
         <input type="button" @click="add()" value="添加">
    </div>
</template>
<script>
export default {
    data(){
        return{
            msg:'我是添加页面',
            remarks:'',
            name:''
        }
    },methods:{
        add(){
             var name=this.name;
            var remarks=this.remarks;
            var formDate =new FormData();
            formDate.append('name',name);
            formDate.append('remarks',remarks);
            var api='http://localhost:8089/admin/role/savea';
            this.$http.post(api,formDate).then(function(date){
            if(date.body.code=='10000'){
                window.location.href="http://localhost:8080/#/role";
            }
             alert(date.body.msg);
         })
           }
        }
    }
</script>